<?php

/**
 * EncDireccion form base class.
 *
 * @method EncDireccion getObject() Returns the current form's model object
 *
 * @package    encuestas
 * @subpackage form
 * @author     qualem
 */
abstract class BaseEncDireccionForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                   => new sfWidgetFormInputHidden(),
      'persona_id'           => new sfWidgetFormPropelChoice(array('model' => 'EncPersona', 'add_empty' => false)),
      'calle'                => new sfWidgetFormInputText(),
      'numero'               => new sfWidgetFormInputText(),
      'colonia'              => new sfWidgetFormInputText(),
      'delegacion_municipio' => new sfWidgetFormInputText(),
      'referencia'           => new sfWidgetFormTextarea(),
      'estado'               => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'                   => new sfValidatorChoice(array('choices' => array($this->getObject()->getId()), 'empty_value' => $this->getObject()->getId(), 'required' => false)),
      'persona_id'           => new sfValidatorPropelChoice(array('model' => 'EncPersona', 'column' => 'id')),
      'calle'                => new sfValidatorString(array('max_length' => 255)),
      'numero'               => new sfValidatorString(array('max_length' => 50)),
      'colonia'              => new sfValidatorString(array('max_length' => 255)),
      'delegacion_municipio' => new sfValidatorString(array('max_length' => 255)),
      'referencia'           => new sfValidatorString(),
      'estado'               => new sfValidatorString(array('max_length' => 255)),
    ));

    $this->widgetSchema->setNameFormat('enc_direccion[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'EncDireccion';
  }


}
